package com.sailfish.springbootdemo.dao.db8;

import com.sailfish.springbootdemo.common.DB8TableName;
import com.sailfish.springbootdemo.pojo.db8.vVplPackage;
import org.apache.ibatis.annotations.*;


import java.util.List;

public interface vVplPackageDao {
    @Select("<script>" +
            "select " +
            "* " +
            "from " + DB8TableName.V_VPL_PACKAGE + " " +
            "where pkg_name = #{pkg_name} and deleted='0' " +
            "</script>"
    )
    List<vVplPackage> getvVplPackage(@Param("pkg_name") String pkg_name);

    @Select("<script>" +
            "SELECT * FROM " + DB8TableName.V_VPL_PACKAGE +
            " WHERE deleted = '0'" +
            "<if test='pkgNames != null and pkgNames.size() > 0'>" +
            " AND pkg_name IN" +
            "<foreach item='pkgName' collection='pkgNames' open='(' separator=',' close=')'>" +
            "#{pkgName}" +
            "</foreach>" +
            "</if>" +
            "</script>")
    List<vVplPackage> getvVplPackageByNames(@Param("pkgNames") List<String> pkgNames);
}
